package org.dtrd.modules.record.entity.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.config.system.Constant;
import org.dtrd.modules.record.entity.po.DtrdEntRdSigninMedicalRecord;

import java.util.Date;

/**
 * <p>
 * 用药记录
 * </p>
 *
 * @author QR
 * @since 2021-12-06
 */
@Data
@ApiModel(value = "DtrdEntRdSigninMedicalRecord数据传输对象", description = "用药记录")
public class MedicalRecordInfo {

    private Integer dataId;

    private Integer patientId;

    @ApiModelProperty("药品库的药品Id")
    private Integer drugId;

    @ApiModelProperty("用药时间")
    private Date recordTime;

    private Date recordDate;

    @ApiModelProperty("照片以 竖线 | 拼接")
    private String medicalRecordPhoto;

    @ApiModelProperty("服用药品描述")
    private String medicalRecordDescribe;

    @ApiModelProperty("1-早,2-午,3-晚,4-睡前")
    private Integer medicalRecordType;

    @ApiModelProperty("1-遵嘱用药,2-漏用药,3-自停药")
    private Integer medicalRecordStatus;

    @ApiModelProperty("用药规格")
    private String medicalSpec;

    @ApiModelProperty("用法用量")
    private String medicalUseMode;

    @ApiModelProperty("备注")
    private String medicalRecordRemark;

    public MedicalRecordInfo() {}

    public MedicalRecordInfo(Integer patientId, Date date, String photo, String desc, Constant.MedicalRecordType type) {
        this.patientId = patientId;
        this.recordTime = date;
        this.medicalRecordPhoto = photo;
        this.medicalRecordType = type.getType();
        this.medicalRecordDescribe = desc;
    }

    public MedicalRecordInfo parseFromPo(DtrdEntRdSigninMedicalRecord po) {
        dataId = po.getDataId();
        patientId = po.getPatientId();
        drugId = po.getDrugId();
        recordTime = po.getRecordTime();
        recordDate = po.getRecordDate();
        medicalRecordPhoto = po.getMedicalRecordPhoto();
        medicalRecordDescribe = po.getMedicalRecordDescribe();
        medicalRecordType = po.getMedicalRecordType();
        medicalSpec = po.getMedicalSpec();
        medicalUseMode = po.getMedicalUseMode();
        medicalRecordRemark = po.getMedicalRecordRemark();
        medicalRecordStatus = po.getMedicalRecordStatus();
        return this;
    }
}
